<?php
/**
 * Created by PhpStorm.
 * User: yuyj
 * Date: 17-1-3
 * Time: 下午7:44
 */

namespace mybackend\controllers;


use common\services\outstock\OutStockStepService;

class OutStockStepController extends BaseController
{
    private $service;

    public function __construct($id, $module, OutStockStepService $outStockOrderService, $config = [])
    {
        $this->service = $outStockOrderService;
        parent::__construct($id, $module, $config);
    }

    /*
     *
     * Author yuyj
     * Date 2017-01-03
     * @apiVersion 1.0.0
     * @api {get} /api/index.php/out-stock-step/get-step-list 获取单据流水
     * @apiGroup out-stock-step-controller
     *
     * @apiParam query {string} orderId 单据ID
     *
     * @apiResponse 200 {
     *  "retCode": 0,
     *  "errMsg": "",
     *  "data": {
     *       "id": "39dc764f-a9c3-dc6e-7c61-384adc74c00d",
     *       "order_id": "39dc764d-499b-2dfc-a469-b9e0be31f002",
     *       "operate_people_id": "814eddb3-832e-e511-9b71-848f69dfab18",
     *       "operate_people_department_id": "68af85a3-c5ee-4626-a00e-3a7efe8a86cc",
     *       "action{操作动作}": "审批",
     *       "result{审批结果}": "审批结果：同意",
     *       "suggestion{审批意见}": "审批通过",
     *       "remarks{备注}": "",
     *       "created_on{操作时间}": "2017-01-03 19:48:25",
     *       "created_by{操作者}": "余云建",
     *       "department_name{部门名称}": "深圳市明源云客电子商务有限公司"
     *   }
     * }
     */
    public function actionGetStepList($orderId)
    {
        $data = $this->service->getStepList($orderId);

        return $this->exportJson($data, $this->service->getErrCode(), $this->service->getErrMsg());
    }


}